#pragma once

#include "Game/Process/RenderProcess.h"
#include "Render/Texture/Picture2DTexture.h"
#include "Render/Texture/RenderTarget.h"
#include "Render/Tradition/RHIRenderPass.h"
#include "Render/Tradition/GraphicsPipeline.h"
#include "Render/Texture/ColorRenderTarget.h"
#include "Render/Texture/CubemapTexture.h"
#include "Render/Texture/DepthRenderTarget.h"
#include "Render/Shader/RHIDescriptor.h"
#include "Render/Tradition/RHIFramebuffer.h"

class LocalScene;
class VoxelProcess;


class BeamProcess : public RenderProcess
{
	DECLARE_PROCESS(BeamProcess)

	struct CameraUbo
	{
		glm::vec4 position;
		glm::vec4 look;
		glm::vec4 right;
		glm::vec4 up;
	};

	struct PushConstants
	{
		uint32 width;
		uint32 height;
		uint32 beamSize;
		float originSize;
	};

public:

	uint32 mBeamSize;
	uint32 mBeamWidth;
	uint32 mBeamHeight;

protected:

	virtual void OnInit() override;

	virtual void OnTick(float deltaTime) override;

	virtual void OnResize() override;

protected:

	uint32 GetBeamSize(uint32 value);

protected:


	LocalScene* mLocalScene;

	VoxelProcess* mVoxelProcess;



	RefCountPtr<RHIBuffer> mCameraUboBuffer;

	RefCountPtr<ColorRenderTarget> mBeamImage;




	RefCountPtr<RHIDescriptor> mDescriptor;

	DescriptorMask mDescriptorMask;


	RefCountPtr<GraphicsPipeline> mPipeline;

	RefCountPtr<RHIRenderPass> mRenderPass;

	RefCountPtr<RHIFrameBuffer> mFrameBuffer;

};
